package cn.zhaozhiqi.autoconfiguration;

import cn.zhaozhiqi.pojo.properties.WeChatIDProperties;
import cn.zhaozhiqi.template.WeChatTemplate;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
@EnableConfigurationProperties(WeChatIDProperties.class)
public class WeChatAutoConfiguration {

    @Bean
    public WeChatTemplate getWeChatTemplate(WeChatIDProperties prop, RestTemplate restTemplate){
        return new WeChatTemplate(restTemplate, prop);
    }

}
